GtkWidget *pixelcache_switch;
GtkWidget *touchscreen_switch;
+ GtkWidget *gl_box;
+ GtkWidget *gl_combo;
+ GtkWidget *software_gl_switch;
+ GtkWidget *software_surface_switch;
+ GtkWidget *texture_rectangle_switch;
+
GtkAdjustment *focus_adjustment;
};
if (direction == GTK_DIR_DOWN &&
widget == vis->priv->visual_box)
next = vis->priv->debug_box;
+ else if (direction == GTK_DIR_DOWN &&
+ widget == vis->priv->debug_box)
+ next = vis->priv->gl_box;
else if (direction == GTK_DIR_UP &&
widget == vis->priv->debug_box)
next = vis->priv->visual_box;
+ else if (direction == GTK_DIR_UP &&
+ widget == vis->priv->gl_box)
+ next = vis->priv->debug_box;
else
next = NULL;
return FALSE;
}
+static void
+init_gl (GtkInspectorVisual *vis)
+{
+ GdkGLFlags flags;
+
+ flags = gdk_gl_get_flags ();
+
+ if (flags & GDK_GL_ALWAYS)
+ gtk_combo_box_set_active_id (GTK_COMBO_BOX (vis->priv->gl_combo), "always");
+ else if (flags & GDK_GL_DISABLE)
+ gtk_combo_box_set_active_id (GTK_COMBO_BOX (vis->priv->gl_combo), "disable");
+ else
+ gtk_combo_box_set_active_id (GTK_COMBO_BOX (vis->priv->gl_combo), "maybe");
+ gtk_widget_set_sensitive (vis->priv->gl_combo, FALSE);
+ gtk_widget_set_tooltip_text (vis->priv->gl_combo,
+ _("Not settable at runtime.\nUse GDK_GL=always or GDK_GL=never instead"));
+
+ gtk_switch_set_active (GTK_SWITCH (vis->priv->software_gl_switch),
+ flags & GDK_GL_SOFTWARE_DRAW_GL);
+ gtk_switch_set_active (GTK_SWITCH (vis->priv->software_surface_switch),
+ flags & GDK_GL_SOFTWARE_DRAW_SURFACE);
+ gtk_switch_set_active (GTK_SWITCH (vis->priv->texture_rectangle_switch),
+ flags & GDK_GL_TEXTURE_RECTANGLE);
+
+ if (flags & GDK_GL_DISABLE)
+ {
+ gtk_widget_set_sensitive (vis->priv->software_gl_switch, FALSE);
+ gtk_widget_set_sensitive (vis->priv->software_surface_switch, FALSE);
+ gtk_widget_set_sensitive (vis->priv->texture_rectangle_switch, FALSE);
+ gtk_widget_set_tooltip_text (vis->priv->software_gl_switch, _("GL rendering is disabled"));
+ gtk_widget_set_tooltip_text (vis->priv->software_surface_switch, _("GL rendering is disabled"));
+ gtk_widget_set_tooltip_text (vis->priv->texture_rectangle_switch, _("GL rendering is disabled"));
+ }
+}
+
+static void
+update_gl_flag (GtkSwitch *sw,
+ GdkGLFlags flag)
+{
+ GdkGLFlags flags;
+
+ flags = gdk_gl_get_flags ();
+
+ if (gtk_switch_get_active (sw))
+ flags |= flag;
+ else
+ flags &= ~flag;
+
+ gdk_gl_set_flags (flags);
+}
+
+static void
+software_gl_activate (GtkSwitch *sw)
+{
+ update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_GL);
+}
+
+static void
+software_surface_activate (GtkSwitch *sw)
+{
+ update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_SURFACE);
+}
+
+static void
+texture_rectangle_activate (GtkSwitch *sw)
+{
+ update_gl_flag (sw, GDK_GL_TEXTURE_RECTANGLE);
+}
+
static void
gtk_inspector_visual_init (GtkInspectorVisual *vis)
{
init_scale (vis);
init_animation (vis);
init_touchscreen (vis);
+ init_gl (vis);
}
static void
g_signal_connect (vis->priv->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->priv->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
+ g_signal_connect (vis->priv->gl_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
}
static void
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, visual_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, debug_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, font_button);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_box);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_combo);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_gl_switch);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_surface_switch);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, texture_rectangle_switch);
gtk_widget_class_bind_template_callback (widget_class, updates_activate);
gtk_widget_class_bind_template_callback (widget_class, direction_changed);
gtk_widget_class_bind_template_callback (widget_class, pixelcache_activate);
gtk_widget_class_bind_template_callback (widget_class, theme_changed);
gtk_widget_class_bind_template_callback (widget_class, icons_changed);
+ gtk_widget_class_bind_template_callback (widget_class, software_gl_activate);
+ gtk_widget_class_bind_template_callback (widget_class, software_surface_activate);
+ gtk_widget_class_bind_template_callback (widget_class, texture_rectangle_activate);
}
// vim: set et sw=2 ts=2:
</child>
</object>
</child>
+ <child>
+ <object class="GtkFrame" id="gl_frame">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <child>
+ <object class="GtkListBox" id="gl_box">
+ <property name="visible">True</property>
+ <property name="selection-mode">none</property>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin">10</property>
+ <property name="spacing">40</property>
+ <child>
+ <object class="GtkLabel" id="gl_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">GL Rendering</property>
+ <property name="halign">start</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="gl_combo">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">baseline</property>
+ <items>
+ <item translatable="yes" id="maybe">When needed</item>
+ <item translatable="yes" id="always">Always</item>
+ <item translatable="yes" id="disable">Disabled</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin">10</property>
+ <property name="spacing">40</property>
+ <child>
+ <object class="GtkLabel" id="software_gl_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Software GL</property>
+ <property name="halign">start</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="software_gl_switch">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">baseline</property>
+ <signal name="notify::active" handler="software_gl_activate"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin">10</property>
+ <property name="spacing">40</property>
+ <child>
+ <object class="GtkLabel" id="software_surface_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Software Surfaces</property>
+ <property name="halign">start</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="software_surface_switch">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">baseline</property>
+ <signal name="notify::active" handler="software_surface_activate"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin">10</property>
+ <property name="spacing">40</property>
+ <child>
+ <object class="GtkLabel" id="texture_rectangle_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Texture Rectangle Extension</property>
+ <property name="halign">start</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="texture_rectangle_switch">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">baseline</property>
+ <signal name="notify::active" handler="texture_rectangle_activate"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</template>
<widget name="baselines_label"/>
<widget name="pixelcache_label"/>
<widget name="touchscreen_label"/>
+ <widget name="gl_label"/>
+ <widget name="software_gl_label"/>
+ <widget name="software_surface_label"/>
+ <widget name="texture_rectangle_label"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<widget name="icon_combo"/>
<widget name="font_button"/>
<widget name="direction_combo"/>
+ <widget name="gl_combo"/>
</widgets>
</object>
<object class="GtkSizeGroup">
<widgets>
<widget name="visual_frame"/>
<widget name="debug_frame"/>
+ <widget name="gl_frame"/>
</widgets>
</object>
</interface>